feat(linux): add content_fixed overlay layer for positioned child webviews (#10420)#1232
Open
ds1 wants to merge 1 commit into
Open
feat(linux): add content_fixed overlay layer for positioned child webviews (#10420)#1232ds1 wants to merge 1 commit into
ds1 wants to merge 1 commit into
Conversation
…views Adds a full-window gtk::Fixed overlay (exposed via WindowExtUnix::content_fixed) so a runtime can position child webviews over the window instead of stacking them in the default vertical gtk::Box. Groundwork for tauri-apps/tauri#10420. Signed-off-by: ds1 <danmakesthings@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On Linux, add a full-window
gtk::Fixedoverlay layer to each window — agtk::Overlaywrapping the default verticalgtk::Box, with the box as the overlay's main child and a pass-throughgtk::Fixedas the overlay layer — exposed viaWindowExtUnix::content_fixed().Why
A runtime (e.g.
tauri-runtime-wry) can build positioned child webviews into thisgtk::Fixedso they overlay the window and honor their bounds, instead of being packed into the verticalgtk::Box, where GTK divides the window height among co-equal children and multi-webview positioning breaks (tauri-apps/tauri#10420). Because the default box stays the overlay's main child and thegtk::Fixedis empty + pass-through for normal windows, single-webview apps are unaffected.This is the
taohalf; thetauri-runtime-wryside (build children intocontent_fixed) and thewryside (position viagtk::Fixed::move_, tauri-apps/wry#1745) complete the fix.Changes
Window: newcontent_fixed: Option<gtk::Fixed>field; content wrapped in agtk::Overlaywith a pass-throughgtk::Fixedoverlay layer.WindowExtUnix::content_fixed() -> Option<>k::Fixed>accessor..changesentry (tao: minor).Testing
Validated in a Tauri v2 app on WSLg (Ubuntu 22.04, WebKitGTK 2.50.4): child webviews built into
content_fixedrender at and hold their bounds (full-window, multi-tab, resize); a single-webview window is unchanged (the default box fills as before).The API name/shape is open to your preference — happy to iterate. Full root cause + three-part fix: #10420.